{% import 'macro.jinja2' as MRO with context %}

{{ MRO.insert_tab()}}if X_test.shape[0] == 0:
{{ MRO.insert_tab()}}    print("Test dataset is empty, use eval dataset instead")
{{ MRO.insert_tab()}}    X_test = X_eval
{{ MRO.insert_tab()}}    y_test = y_eval
{{ MRO.insert_tab()}}else:
{{ MRO.insert_tab()}}    if y_test is None:
{{ MRO.insert_tab()}}        print("Test dataset is empty, use eval dataset instead")
{{ MRO.insert_tab()}}        X_test = X_eval
{{ MRO.insert_tab()}}        y_test = y_eval
{{ MRO.insert_tab()}}y_pred = estimator.predict(X_test)
{% if task_type != 'regression' %}
{{ MRO.insert_tab()}}y_score = estimator.predict_proba(X_test)
{% if framework == 'HyperGBM' %}
{{ MRO.insert_tab()}}y_pos_score = y_score[:, 1]
{% elif framework == 'DeepTables'  %}
{{ MRO.insert_tab()}}y_pos_score = y_score
{% endif %}
{% endif %}
{% if target_source_type == 'raw_python' %}
{% if task_type == 'binary_classification' %}
{% include "evaluate_binary_classification.jinja2" %}
{% elif task_type == 'multi_classification' %}
{% include "evaluate_multi_classification.jinja2" %}
{% elif task_type == 'regression' %}
{% include "evaluate_regression.jinja2" %}
{% endif %}
{{ MRO.insert_tab()}}evaluate_extension['performance'] = performance
{% endif %}